extends layout

block content
  - var imagelikes = likes ? likes : 0
  .row
    .col-12.col-md-8
      .card
        img.card-img-top(src=`/uploads/${diskfilename}`, alt=title)
        .card-body.d-flex.justify-content-between
          div.inline-block
            #{title}
            span.text-danger
              i.fas.fa-kiss-wink-heart.pr-3#likesnum= imagelikes 
              i 个赞
          button.btn.btn-primary#likes-btn(data-imageid=_id)
            span.font-weight-bold
              i.far.fa-kiss-wink-heart.pr-3
              i 赞
          span= "作者: " + imageauthor

      .list-group.mt-1
        each comment in comments
          li.list-group-item
            p= comment.comment
            p= comment.nickname
            p= comment.email
    .col-12.col-md-4
      include includes/stats.pug
      include includes/commentlast.pug
  .row
    .col-12.col-md-8
      .card
        .card-body
          h4.card-title 发表评论
          form(action=`/comments/${_id}`, method="post")
            .form-group.row
              label.col-12.col-md-2 邮箱
              input#email.col-12.col-md-12.form-control(type="email", name="email")
            .form-group.row
              label.col-12.col-md-2 昵称
              input#nickname.col-12.col-md-12.form-control(type="text", name="nickname")
            .form-group.row
              label.col-12.col-md-2 评论
              textarea#comment.col-12.col-md-12.form-control(rows="5", name="comment")
            .form-group.row
              .col-12.offset-md-8.col-md-4
                button.btn.btn-primary.btn-block(type="submit") 保存评论
  .row
    .col-12.offset-md-4.col-md-4
      p 图片展示与上传 &copy 闫旭 2018 版权所有
  script(src="/javascripts/show.js")
